package com.smalls.redshoes.ui.orderstate;

import java.util.Date;

public class OrderState {
    static private int index=0;
    private int id;
    private Date datetime;
    private OrderStateEnum state;

    public OrderState(OrderStateEnum state_){
        this.datetime=new Date();
        this.id = OrderState.index++;
        this.state = state_;
    }

    public String getDateTime(){
        return datetime.toString();
    }

    public String getId() {
        return  Integer.toString(id);

    }
    public String getState() {
        switch (state){
            case OrderState_INVALID:
                return "非法状态";
            case OrderState_START:
                return "订单状态开始,正在准备完成";
            case OrderState_COMPLELTE:
                return "订单状态已经完成";
            case OrderState_ERROR:
                return "订单状态出错";
            default:
                return "未知状态";
        }
    }
    @Override
    public String toString() {
        return getId() + '@' + getState() + '@' + getDateTime();
    }
}